Optimal. Leaf size=280 \[ \frac{x \sqrt{a+c x^2} \left (a^2 f h^2-2 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{16 c^2}+\frac{a \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) \left (a^2 f h^2-2 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{16 c^{5/2}}-\frac{\left (a+c x^2\right )^{3/2} \left (8 \left (2 a h^2 (e h+2 f g)+c g \left (f g^2-2 h (5 d h+e g)\right )\right )-3 h x \left (5 h^2 (2 c d-a f)-2 c g (f g-2 e h)\right )\right )}{120 c^2 h}-\frac{\left (a+c x^2\right )^{3/2} (g+h x)^2 (f g-2 e h)}{10 c h}+\frac{f \left (a+c x^2\right )^{3/2} (g+h x)^3}{6 c h} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.498083, antiderivative size = 279, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.207, Rules used = {1654, 833, 780, 195, 217, 206} \[ \frac{x \sqrt{a+c x^2} \left (a^2 f h^2-2 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{16 c^2}+\frac{a \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) \left (a^2 f h^2-2 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{16 c^{5/2}}-\frac{\left (a+c x^2\right )^{3/2} \left (8 \left (2 a h^2 (e h+2 f g)-2 c g h (5 d h+e g)+c f g^3\right )-3 h x \left (5 h^2 (2 c d-a f)-2 c g (f g-2 e h)\right )\right )}{120 c^2 h}-\frac{\left (a+c x^2\right )^{3/2} (g+h x)^2 (f g-2 e h)}{10 c h}+\frac{f \left (a+c x^2\right )^{3/2} (g+h x)^3}{6 c h} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1654
Rule 833
Rule 780
Rule 195
Rule 217
Rule 206
Rubi steps
\begin{align*} \int (g+h x)^2 \sqrt{a+c x^2} \left (d+e x+f x^2\right ) \, dx &=\frac{f (g+h x)^3 \left (a+c x^2\right )^{3/2}}{6 c h}+\frac{\int (g+h x)^2 \left (3 (2 c d-a f) h^2-3 c h (f g-2 e h) x\right ) \sqrt{a+c x^2} \, dx}{6 c h^2}\\ &=-\frac{(f g-2 e h) (g+h x)^2 \left (a+c x^2\right )^{3/2}}{10 c h}+\frac{f (g+h x)^3 \left (a+c x^2\right )^{3/2}}{6 c h}+\frac{\int (g+h x) \left (3 c h^2 (10 c d g-3 a f g-4 a e h)+3 c h \left (5 (2 c d-a f) h^2-2 c g (f g-2 e h)\right ) x\right ) \sqrt{a+c x^2} \, dx}{30 c^2 h^2}\\ &=-\frac{(f g-2 e h) (g+h x)^2 \left (a+c x^2\right )^{3/2}}{10 c h}+\frac{f (g+h x)^3 \left (a+c x^2\right )^{3/2}}{6 c h}-\frac{\left (8 \left (c f g^3-2 c g h (e g+5 d h)+2 a h^2 (2 f g+e h)\right )-3 h \left (5 (2 c d-a f) h^2-2 c g (f g-2 e h)\right ) x\right ) \left (a+c x^2\right )^{3/2}}{120 c^2 h}+\frac{\left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right ) \int \sqrt{a+c x^2} \, dx}{8 c^2}\\ &=\frac{\left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right ) x \sqrt{a+c x^2}}{16 c^2}-\frac{(f g-2 e h) (g+h x)^2 \left (a+c x^2\right )^{3/2}}{10 c h}+\frac{f (g+h x)^3 \left (a+c x^2\right )^{3/2}}{6 c h}-\frac{\left (8 \left (c f g^3-2 c g h (e g+5 d h)+2 a h^2 (2 f g+e h)\right )-3 h \left (5 (2 c d-a f) h^2-2 c g (f g-2 e h)\right ) x\right ) \left (a+c x^2\right )^{3/2}}{120 c^2 h}+\frac{\left (a \left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right )\right ) \int \frac{1}{\sqrt{a+c x^2}} \, dx}{16 c^2}\\ &=\frac{\left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right ) x \sqrt{a+c x^2}}{16 c^2}-\frac{(f g-2 e h) (g+h x)^2 \left (a+c x^2\right )^{3/2}}{10 c h}+\frac{f (g+h x)^3 \left (a+c x^2\right )^{3/2}}{6 c h}-\frac{\left (8 \left (c f g^3-2 c g h (e g+5 d h)+2 a h^2 (2 f g+e h)\right )-3 h \left (5 (2 c d-a f) h^2-2 c g (f g-2 e h)\right ) x\right ) \left (a+c x^2\right )^{3/2}}{120 c^2 h}+\frac{\left (a \left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right )\right ) \operatorname{Subst}\left (\int \frac{1}{1-c x^2} \, dx,x,\frac{x}{\sqrt{a+c x^2}}\right )}{16 c^2}\\ &=\frac{\left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right ) x \sqrt{a+c x^2}}{16 c^2}-\frac{(f g-2 e h) (g+h x)^2 \left (a+c x^2\right )^{3/2}}{10 c h}+\frac{f (g+h x)^3 \left (a+c x^2\right )^{3/2}}{6 c h}-\frac{\left (8 \left (c f g^3-2 c g h (e g+5 d h)+2 a h^2 (2 f g+e h)\right )-3 h \left (5 (2 c d-a f) h^2-2 c g (f g-2 e h)\right ) x\right ) \left (a+c x^2\right )^{3/2}}{120 c^2 h}+\frac{a \left (8 c^2 d g^2+a^2 f h^2-2 a c \left (f g^2+h (2 e g+d h)\right )\right ) \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right )}{16 c^{5/2}}\\ \end{align*}
Mathematica [A] time = 0.697218, size = 256, normalized size = 0.91 \[ \frac{\sqrt{a+c x^2} \left (\sqrt{c} \left (a^2 (-h) (32 e h+64 f g+15 f h x)+2 a c \left (5 d h (16 g+3 h x)+e \left (40 g^2+30 g h x+8 h^2 x^2\right )+f x \left (15 g^2+16 g h x+5 h^2 x^2\right )\right )+4 c^2 x \left (5 d \left (6 g^2+8 g h x+3 h^2 x^2\right )+x \left (2 e \left (10 g^2+15 g h x+6 h^2 x^2\right )+f x \left (15 g^2+24 g h x+10 h^2 x^2\right )\right )\right )\right )+\frac{15 \sqrt{a} \sinh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) \left (a^2 f h^2-2 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{\sqrt{\frac{c x^2}{a}+1}}\right )}{240 c^{5/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.054, size = 446, normalized size = 1.6 \begin{align*}{\frac{f{h}^{2}{x}^{3}}{6\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}-{\frac{af{h}^{2}x}{8\,{c}^{2}} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}+{\frac{{a}^{2}f{h}^{2}x}{16\,{c}^{2}}\sqrt{c{x}^{2}+a}}+{\frac{f{h}^{2}{a}^{3}}{16}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{5}{2}}}}+{\frac{e{x}^{2}{h}^{2}}{5\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}+{\frac{2\,fg{x}^{2}h}{5\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}-{\frac{2\,ae{h}^{2}}{15\,{c}^{2}} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}-{\frac{4\,afgh}{15\,{c}^{2}} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}+{\frac{dx{h}^{2}}{4\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}+{\frac{egxh}{2\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}+{\frac{fx{g}^{2}}{4\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}-{\frac{axd{h}^{2}}{8\,c}\sqrt{c{x}^{2}+a}}-{\frac{aexgh}{4\,c}\sqrt{c{x}^{2}+a}}-{\frac{axf{g}^{2}}{8\,c}\sqrt{c{x}^{2}+a}}-{\frac{{a}^{2}d{h}^{2}}{8}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}-{\frac{{a}^{2}egh}{4}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}-{\frac{{a}^{2}f{g}^{2}}{8}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}+{\frac{2\,dgh}{3\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}+{\frac{e{g}^{2}}{3\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}+{\frac{d{g}^{2}x}{2}\sqrt{c{x}^{2}+a}}+{\frac{d{g}^{2}a}{2}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){\frac{1}{\sqrt{c}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.60811, size = 1319, normalized size = 4.71 \begin{align*} \left [-\frac{15 \,{\left (4 \, a^{2} c e g h - 2 \,{\left (4 \, a c^{2} d - a^{2} c f\right )} g^{2} +{\left (2 \, a^{2} c d - a^{3} f\right )} h^{2}\right )} \sqrt{c} \log \left (-2 \, c x^{2} - 2 \, \sqrt{c x^{2} + a} \sqrt{c} x - a\right ) - 2 \,{\left (40 \, c^{3} f h^{2} x^{5} + 80 \, a c^{2} e g^{2} - 32 \, a^{2} c e h^{2} + 48 \,{\left (2 \, c^{3} f g h + c^{3} e h^{2}\right )} x^{4} + 10 \,{\left (6 \, c^{3} f g^{2} + 12 \, c^{3} e g h +{\left (6 \, c^{3} d + a c^{2} f\right )} h^{2}\right )} x^{3} + 32 \,{\left (5 \, a c^{2} d - 2 \, a^{2} c f\right )} g h + 16 \,{\left (5 \, c^{3} e g^{2} + a c^{2} e h^{2} + 2 \,{\left (5 \, c^{3} d + a c^{2} f\right )} g h\right )} x^{2} + 15 \,{\left (4 \, a c^{2} e g h + 2 \,{\left (4 \, c^{3} d + a c^{2} f\right )} g^{2} +{\left (2 \, a c^{2} d - a^{2} c f\right )} h^{2}\right )} x\right )} \sqrt{c x^{2} + a}}{480 \, c^{3}}, \frac{15 \,{\left (4 \, a^{2} c e g h - 2 \,{\left (4 \, a c^{2} d - a^{2} c f\right )} g^{2} +{\left (2 \, a^{2} c d - a^{3} f\right )} h^{2}\right )} \sqrt{-c} \arctan \left (\frac{\sqrt{-c} x}{\sqrt{c x^{2} + a}}\right ) +{\left (40 \, c^{3} f h^{2} x^{5} + 80 \, a c^{2} e g^{2} - 32 \, a^{2} c e h^{2} + 48 \,{\left (2 \, c^{3} f g h + c^{3} e h^{2}\right )} x^{4} + 10 \,{\left (6 \, c^{3} f g^{2} + 12 \, c^{3} e g h +{\left (6 \, c^{3} d + a c^{2} f\right )} h^{2}\right )} x^{3} + 32 \,{\left (5 \, a c^{2} d - 2 \, a^{2} c f\right )} g h + 16 \,{\left (5 \, c^{3} e g^{2} + a c^{2} e h^{2} + 2 \,{\left (5 \, c^{3} d + a c^{2} f\right )} g h\right )} x^{2} + 15 \,{\left (4 \, a c^{2} e g h + 2 \,{\left (4 \, c^{3} d + a c^{2} f\right )} g^{2} +{\left (2 \, a c^{2} d - a^{2} c f\right )} h^{2}\right )} x\right )} \sqrt{c x^{2} + a}}{240 \, c^{3}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 19.0432, size = 738, normalized size = 2.64 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.19823, size = 433, normalized size = 1.55 \begin{align*} \frac{1}{240} \, \sqrt{c x^{2} + a}{\left ({\left (2 \,{\left ({\left (4 \,{\left (5 \, f h^{2} x + \frac{6 \,{\left (2 \, c^{4} f g h + c^{4} h^{2} e\right )}}{c^{4}}\right )} x + \frac{5 \,{\left (6 \, c^{4} f g^{2} + 6 \, c^{4} d h^{2} + a c^{3} f h^{2} + 12 \, c^{4} g h e\right )}}{c^{4}}\right )} x + \frac{8 \,{\left (10 \, c^{4} d g h + 2 \, a c^{3} f g h + 5 \, c^{4} g^{2} e + a c^{3} h^{2} e\right )}}{c^{4}}\right )} x + \frac{15 \,{\left (8 \, c^{4} d g^{2} + 2 \, a c^{3} f g^{2} + 2 \, a c^{3} d h^{2} - a^{2} c^{2} f h^{2} + 4 \, a c^{3} g h e\right )}}{c^{4}}\right )} x + \frac{16 \,{\left (10 \, a c^{3} d g h - 4 \, a^{2} c^{2} f g h + 5 \, a c^{3} g^{2} e - 2 \, a^{2} c^{2} h^{2} e\right )}}{c^{4}}\right )} - \frac{{\left (8 \, a c^{2} d g^{2} - 2 \, a^{2} c f g^{2} - 2 \, a^{2} c d h^{2} + a^{3} f h^{2} - 4 \, a^{2} c g h e\right )} \log \left ({\left | -\sqrt{c} x + \sqrt{c x^{2} + a} \right |}\right )}{16 \, c^{\frac{5}{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]